package advice;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * Author：汤小洋
 * Date：2022-11-28 10:25
 * Description：<描述>
 */
@ControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public String exception(Exception e){
        System.out.println("警报，程序出现异常，发短信："+e.getMessage());

        return "error";
    }
}
